﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace devtm.Aop.Emit
{
    
    public class Label
    {



        internal int m_label;
        internal Label(int label)
        {
            this.m_label = label;
            Instructions = new List<Mono.Cecil.Cil.Instruction>();
        }

        internal int GetLabelValue()
        {
            return this.m_label;
        }

        public override int GetHashCode()
        {
            return this.m_label;
        }

        public override bool Equals(object obj)
        {
            return ((obj is Label) && this.Equals((Label)obj));
        }

        public bool Equals(Label obj)
        {
            return (obj.m_label == this.m_label);
        }

        public static bool operator ==(Label a, Label b)
        {
            return a.Equals(b);
        }

        public static bool operator !=(Label a, Label b)
        {
            return !(a == b);
        }

        public List<Mono.Cecil.Cil.Instruction> Instructions { get; set; }

        public Mono.Cecil.Cil.Instruction Instruction { get; set; }

        public bool IsMarked { get { return Instruction != null; } }

    }



}
